package com.example.zx_springboot.controller;

import com.example.zx_springboot.entity.ZxRole;
import com.example.zx_springboot.entity.ZxUser;
import com.example.zx_springboot.service.URRService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ZxURRController {
    @Autowired
    private URRService urrService;
    @GetMapping("/selectuser/{id}")//设置查询方式
    public ZxUser selectUser(@PathVariable("id") Integer id)//通过@PathVariable获取id的路径
    {
        ZxUser zxUser =urrService.selectUserById(id);
        return zxUser;
    }
    @GetMapping("/selectrole/{id}")
    public ZxRole selectRole(@PathVariable("id") Integer id)
    {
        ZxRole zxRole =urrService.selectRoleById(id);
        System.out.println(zxRole);
        return zxRole;
    }
}
